import createPersistedState from "vuex-persistedstate";

export default{
    namespaced: true,
    state: {
       domain: '',
    },
    mutations: {
        setDomain(state,domain){
            state.domain=domain;

        },

    },
    plugins: [ createPersistedState({
        storage: window.sessionStorage, // 存储方式改为sessionStorage
        key:"state",
        render(state){
            return {...state}
        }
    })
],
    getters: {
        getDomain(state){
          return this.state.domain;
        }
    }
}